import json
from app import BASE_DIR
def build_add_data1():
    with open(BASE_DIR + '/test10_data1.json') as f:
        data = json.load(f)

    return data

def build_add_data2():
    with open(BASE_DIR + '/test10_data2.json') as f:
        data_list = json.load(f)

    new_list = []
    for data in data_list:  # 字典
        a = data.get('a')
        b = data.get('b')
        expect = data.get('expect')
        new_list.append((a, b, expect))

    return new_list

def build_add_data3():
    with open(BASE_DIR + '/test10_data2.json') as f:
        data_list = json.load(f)

    new_list = []
    for data in data_list:  # 字典
        new_list.append(tuple(data.values()))

    return new_list

if __name__ == '__main__':
    print(build_add_data1())
    print(build_add_data2())
    print(build_add_data3())